<script>
import outMain from "@/components/outMain.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { CrewmanageDetail } from "@/http/api";
export default {
  components: { outMain },
  name: "",
  data() {
    return {
      formData: {},
      detailId: this.$route.query.id,
    };
  },
  props: {},
  setup() {},
  methods: {
    linkFn(url, id, navId) {
      if (id != 0) {
        this.$router.push({ path: url, query: { id: id, navId: navId } });
      }
    },
    backFn() {
      this.$router.back();
    },
    getData() {
      CrewmanageDetail({ invite_interview_id: this.detailId }).then((res) => {
        if (res.data.code == 1) {
          this.formData = res.data.data;
        }
      });
    },
    interFn(id) {
      this.$router.push({ path: "/bootInviteDetail", query: { id: id } });
      this.detailId = id;
      this.getData();
    },
  },
  mounted() {},
  created() {
    this.getData();
  },
};
</script>
<template>
  <outMain @inter="interFn">
    <div class="formCont">
      <div class="formStep">
        <div class="formHead">
          <div>面试详情</div>
          <btn value="返回上一级" @ok="backFn"></btn>
        </div>
        <div class="formMain">
          <div class="stepCont">
            <div class="formDes">
              <div class="desTitle">船员信息</div>
              <div class="desCont">
                <div class="desItem">
                  <div class="desName">船员姓名</div>
                  <div class="desText">
                    <span
                      class="linkText_"
                      @click="
                        linkFn(
                          'salaPublicDetail',
                          formData.biographical_notes_id
                        )
                      "
                    >
                      {{ formData.b_real_name }}
                    </span>
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">船员电话</div>
                  <div class="desText">{{ formData.b_mobile }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">面试岗位</div>
                  <div class="desText">
                    <span
                      class="linkText_"
                      @click="
                        linkFn(
                          'workListDetail',
                          formData.enterprise_position_id
                        )
                      "
                    >
                      {{ formData.position_name }}
                    </span>
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">面试时间</div>
                  <div class="desText">{{ formData.interview_time }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">创建时间</div>
                  <div class="desText">{{ formData.create_time }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">面试状态</div>
                  <div class="desText">
                    <el-tag v-if="formData.interview_status == 1"
                      >面试中</el-tag
                    >
                    <el-tag type="success" v-if="formData.interview_status == 2"
                      >面试成功</el-tag
                    >
                    <el-tag type="danger" v-if="formData.interview_status == 3"
                      >面试失败</el-tag
                    >
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">面试单号</div>
                  <div class="desText">
                    {{ formData.invite_interview_number }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">更新时间</div>
                  <div class="desText">{{ formData.update_time }}</div>
                </div>
                <div class="desItem" v-if="formData.failure_reason">
                  <div class="desName">面试失败原因</div>
                  <div class="desText">
                    {{
                      formData.failure_reason ? formData.failure_reason : "- -"
                    }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">面试公司</div>
                  <div class="desText">
                    <span
                      :class="
                        formData.interview_enterprise_id == 0 ? '' : 'linkText_'
                      "
                      @click="
                        linkFn(
                          'cooperationBooterDetail',
                          formData.interview_enterprise_id
                        )
                      "
                    >
                      {{ formData.enterprise_name }}
                    </span>
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">操作员工</div>
                  <div class="desText">
                    <span
                      :class="formData.staff_id == 0 ? '' : 'linkText_'"
                      @click="linkFn('staffListDetail', formData.staff_id)"
                    >
                      {{ formData.staff_name }}
                    </span>
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">面试负责人</div>
                  <div class="desText">{{ formData.enterprise_person }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">面试企业电话</div>
                  <div class="desText">{{ formData.enterprise_mobile }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </outMain>
</template>
<style scoped lang="less"></style>
